<?php
class Request {

	private $url;
	private $form;
	private $files;
	private $server;

	public function __construct() {
		$this->url = $this->_url();
		$this->server = $this->_serverName();
		$this->form = $this->_form();
		$this->files = $this->_files();
	}

	public function getUrl() {
		return $this->url;
	}
		
	public function getServerName() {
		return $this->server;
	}
		
	public function getForm() {
		return $this->form;
	}
		
	public function getFiles() {
		return $this->files;
	}
		

	private function _url() {
		return $_SERVER['REQUEST_URI'];
	}
		
	private function _form() {
		if(array_key_exists("form-action", $_POST)) {
			return $_POST;
		} else {
			return null;
		}
	}
		
	private function _files() {
		if(isset($_FILES)) {
			return $_FILES;
		} else {
			return null;
		}
	}
		
	private function _serverName() {
		return $_SERVER['SERVER_NAME'];
	}

}
